/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.msk.wlhy.mapper;


import com.msk.sys.mapper.CrudDao;
import com.msk.wlhy.domain.HtLogisticsOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>[]</p>
 * <p>作者：zkp</p>
 * <p>邮箱：zkp@xiangyou.com</p>
 * <p>创建时间： 2018-06-07 </p>
 * <p>类说明：物流订单DAO接口 </p>
 * <p>修改记录：</p>
 */
@Repository
public interface HtLogisticsOrderDao extends CrudDao<HtLogisticsOrder> {
	public Long findCount(HtLogisticsOrder htLogisticsOrder);
	public List<HtLogisticsOrder> findListByDetailIds(String detailIds);
	
	public List<Map<String,Object>> findListByTransportId(String transportId);

	/**
	 * 通过货物的id查询对应的合同数量
	 * @param goodId
	 * @return
	 */
	public Long getCountByGoodId(String goodId);

	/**
	 * 获取物流订单统计数据
	 * @description getCountGroupbyOffice
	 * @date 2018-7-3
	 * @author chuming
	 * @param htLogisticsOrder
	 * @return
	 */
	public List<Map<String,Object>> getCountGroupbyOffice(HtLogisticsOrder htLogisticsOrder);
	/**
	 * 获取物流订单详情未完成的条数
	 * @description findCountByOrderId
	 * @date 2018-7-9
	 * @author chuming
	 * @param orderId   物流订单Id
	 * @return
	 */
	public Long findCountByOrderId(String orderId);
	
	/**
	 * 插入数据
	 * @return
	 */
	public int insert(HtLogisticsOrder htLogisticsOrder);
	
	/**
	 * 更新数据
	 * @return
	 */
	public int update(HtLogisticsOrder htLogisticsOrder);

	/**
	 * 根据Id条件更新数据
	 * @param htLogisticsOrder
	 * @return
	 */
	public int updateInfoById(HtLogisticsOrder htLogisticsOrder);

	public String getOrderNo();

	/**
	 * 根据货源Id更新货主合同
	 * @param htLogisticsOrder
	 * @param goodsId
	 * @return
	 */
	public int updateByGoodsId(@Param("htLogisticsOrder") HtLogisticsOrder htLogisticsOrder,@Param("goodsId") String goodsId);

	/**
	 * 根据货源Id查询货主合同
	 * @param goodsId
	 * @return
	 */
	public HtLogisticsOrder selectByGoodsId(String goodsId);
}